Drainage and Utilities CONNECT Edition Help

Custom Queries

Use Custom Queries to create a customized, intermediate data table that SCADAConnect can read. The query can add new fields based on available field values in the data source, allowing data to be translated from a specific user format to the SCADAConnect format. It can also be used to add validation of the SCADA data.

For example, if the signal data supports a timestamp field, SCADAConnect expects the data to be presented in a single Date/Time field. However, if the timestamp in the data source is stored in two separate fields, a custom query can be written to present the two fields to SCADAConnect as a single DateTime field.



This will generate an intermediate data table with all the fields from the table plus a new calculated field called TimeStamp that contains the Date/Time values. This TimeStamp field is the field name that should be entered in the Time Stamp of Data Source Manager dialog.

Another example would be to use a query that will add extra data validation to remove errors. If signal values are known to always be within a certain range, the following query could be written to mark those signals as Questionable and then allow SCADAConnect to skip those values.



This will generate a field called Questionable that can be used in the Questionable of Data Source Manager dialog. When the data is read by SCADAConnect, data records with values outside this range will have the Questionable field set to TRUE, and SCADAConnect will discard the value.

Note: When custom queries are entered, they should have valid SQL syntax for the data source being used. Custom queries are sent to the database provider and therefore the Advanced Options of the Connection Manager do not apply to these queries.